<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>OOH</title>
<script src="../js/jquery-1.8.0.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				/*
				$(".red").css("backgroundColor","red");
				$(".yellow").css("backgroundColor","yellow");
				*/
				$("tr:odd").css("backgroundColor","red");
				/*直接用background也可以 */
				$("tr:even").css("background","yellow");
			})
		</script>
	</head>
	<body>
		<br><a href="../index.jsp">back</a>
		<br><hr color="red" />
		<h5>jquery控制表格css</h5>
		<table border="1" width="80" align="left" cellpadding="0" cellspacing="0" >
			<tr class="red"><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td></tr>
			<tr class="yellow"><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td></tr>
			<tr class="red"><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td></tr>
			<tr class="yellow"><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td></tr>
			<tr class="red"><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td></tr>
			<tr class="yellow"><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td></tr>
			<tr class="red"><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td><td>demo</td></tr>
		</table>
	</body>
</html>